//
//  WGQHomeAlertTableViewCell.m
//  MaYi
//
//  Created by 小破夕 on 2018/9/8.
//  Copyright © 2018年 JUMI. All rights reserved.
//

#import "WGQTransfersRecordsAlertTableViewCell.h"
#import "WGQTransfersRecordsBabyModel.h"

@interface WGQTransfersRecordsAlertTableViewCell ()

@property (nonatomic,strong) UILabel * titleLabel;
@property (nonatomic,strong) UIView * lineView;

@end

@implementation WGQTransfersRecordsAlertTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont fontWithName:kMainFontFormat size:14 * kScale];
    self.titleLabel.textColor = FFColor(0x333333);
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make)
    {
    make.left.and.top.and.right.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-2 * kScale);
    }];
    
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = FFColor(0xebebeb);
    [self.contentView addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make)
    {
        make.left.equalTo(self.contentView.mas_left).offset(4 *kScale);
        make.right.equalTo(self.contentView.mas_right).offset(-4 * kScale);
        make.height.mas_equalTo(2 * kScale);
        make.bottom.equalTo(self.contentView.mas_bottom);
    }];
}

- (void)setObject:(id)object
{
    if ([object isKindOfClass:[WGQTransfersRecordsBabyModel class]])
    {
        WGQTransfersRecordsBabyModel * model = object;
        self.titleLabel.text = [NSString stringWithFormat:@"%@",model.cname];
    }
    
    if ([object isKindOfClass:[NSString class]])
    {
        self.titleLabel.text = object;
    }
}

- (void)awakeFromNib
{
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end
